﻿using System;
using System.Xml;

namespace SZJT.Framework.Services
{
    [Serializable]
    public class ServiceException : ApplicationException
    {
        public ServiceException(int code, string message)
            : base(message)
        {
            Code = code;
        }

        public int Code
        {
            get;
            set;
        }

        public override string ToString()
        {
            return Code.ToString();
        }

        public XmlDocument ToXml()
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(ToString());

            return doc;
        }
  
    }
}
